﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using rock.UI.pictureinfo.subview;

namespace rock.UI.pictureinfo
{
    public partial class UserControlFoodMarkFloorOnekPicture : UserControl
    {
        public UserControlFoodMarkFloorOnekPicture()
        {
            InitializeComponent();
        }

        private void UserControlFoodMarkFloorOnekPicture_Load(object sender, EventArgs e)
        {
            getHouse(list, this);
        }

        

        List<UserControlHouse> list = new List<UserControlHouse>();


        public void refreshStatus()
        {
            this.progressBar1.Maximum = list.Count;
            int index = 1;
            foreach (UserControlHouse temp in list)
            {
                temp.inits();
                this.progressBar1.Value = index++;
            }
        }
        public void getHouse(List<UserControlHouse> list, Control parentControl)
        {
            foreach (Control c in parentControl.Controls)
            {
                if (c is UserControlHouse)
                {
                    UserControlHouse temp = (UserControlHouse)c;
                    list.Add(temp);
                }
                else
                {
                    getHouse(list, c);
                }
            }

        }
        private void button1_Click(object sender, EventArgs e)
        {
            refreshStatus();
        }

        

    }
}
